What is the new “builder API” in Angular CLI 21?
158
23-Dec-2025
Updated on 23-Dec-2025
Anubhav Kumar
23-Dec-2025What the Builder API Is
The Builder API (often just called Angular CLI Builders) isn’t brand-new in Angular 21—it’s been part of the Angular CLI for years as the mechanism that executes CLI tasks like
ng build,ng serve, andng testby delegating to “builders.” A builder is a function that performs a task (build, test, serve, etc.) based on options and context provided by the CLI. You can also write custom builders to extend the CLI’s capabilities.In Angular CLI:
angular.jsonunder"architect"(or"targets"in newer formats).Why It Matters in Angular CLI 21
While the underlying Builder API hasn’t fundamentally changed just for v21, Angular 21 makes greater use of it by shifting default tooling toward new, modern builders:
Default Builders Evolved
Angular CLI 21 now uses more modern builders out of the box:
@angular/build:unit-testas the default forng testinstead of the older Karma/Jasmine builders.@angular/build:application) that uses esbuild + Vite for faster builds and dev server tasks.These builders are implemented using the Builder API and configured in
angular.json, so the CLI commands now delegate to new underlying implementations. The Builder API makes this extensible and configurable.Custom Builders Still Supported
You can still create your own builders to:
This is done using the Builder API utilities like
createBuilder()and implementing a builder handler that returns aBuilderOutput.TL;DR